/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.recorder.navdata;

import java.io.IOException;

import fr.uha.ensisa.jmp.drone.navdata.options.NavdataDemo;
import fr.uha.ensisa.jmp.drone.recorder.TextFileWriter;


public class NavdataDemoRawWriter extends TextFileWriter<NavdataDemo>
{
	private final char separator;
	
	public NavdataDemoRawWriter(char separator)
	{
		this.separator = separator;
	}
	
	@Override
	public void write(NavdataDemo record) throws IOException
	{
		this.writer.print(record.ctrl_state); this.writer.print(this.separator);
		this.writer.print(record.vbat_flying_percentage); this.writer.print(this.separator);
		this.writer.print(record.theta); this.writer.print(this.separator);
		this.writer.print(record.phi); this.writer.print(this.separator);
		this.writer.print(record.psi); this.writer.print(this.separator);
		this.writer.print(record.altitude); this.writer.print(this.separator);
		this.writer.print(record.vx); this.writer.print(this.separator);
		this.writer.print(record.vy); this.writer.print(this.separator);
		this.writer.print(record.vz); this.writer.print(this.separator);
		this.writer.print(record.num_frames); this.writer.print(this.separator);
		this.writer.println();
		this.writer.flush();
	}
}
